1. Field of the Invention
This invention relates generally to image processing and, more specifically, to a system and method for reducing the appearance of errors in gradient-based image compositing.
2. Description of the Related Art
In photo editing, the need often arises for stitching together two or more images into a single composite image. For example, two offset images of the same scene may be stitched together to produce a single composite panoramic image of the scene. Alternatively, images of two different scenes may be combined to generate a composite scene. For example, a user may overlay an image of a tree onto an image of a field, in order to produce a scene of a tree growing in a field.
However, straightforward approaches to image stitching may cause harsh and noticeable transition effects at the boundaries (i.e., seams) between the combined images. Gradient compositing is a popular technique for stitching images together, either for local edits or panorama stitching, wherein the appearance of transition effects is mitigated. In such methods, two or more images are first delineated and a target image gradient field and boundary conditions are calculated from the images. A gradient field may comprise a series of vectors, each corresponding to a region of an image (e.g., a pixel coordinate) and having a direction and amplitude indicating the direction and amplitude of color intensity changes in the image at the corresponding region. The direction/amplitude of each vector may be a function of the color/intensity of numerous other pixels in the input images. Various methods are currently used to calculate the target gradient field of a composite image. For example, the target gradient field may be determined using the gradient fields of the input images.
Once a target gradient field v is calculated, a solution composite image I is determined such that the gradient field of I differs least from v. In some methods, the closeness of a proposed image solution I may be quantified by a least-squares measurement. In some techniques, determining an appropriate I involves setting up and solving a Poisson equation with the appropriate parameters.
However, a shortcoming of traditional gradient compositing is that it is sometimes impossible to determine a solution composite image whose gradient field matches the target gradient field exactly. Such inexact solution images may contain undesirable error artifacts, known as residuals.